<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover"><title>问题笔记 | David 的博客</title><meta name="author" content="David"><meta name="copyright" content="David"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="遇到的问题&amp;解决方案【持续更新~】2023-09-16 笔记解决 MP4 视频转成 m3u8 格式的问题 需求描述： 现在需要批量将一些存放在文件夹下的 MP4 视频转成 m3u8 格式，其中视频存放的位置可能是多层文件夹下，m3u8 视频需要分门别类的存放  解决思路  使用 Python + ffmpeg 实现视频的转码 使用多线程加速视频的转码   遇到的问题  多个视频不能按照预设">
<meta property="og:type" content="article">
<meta property="og:title" content="问题笔记">
<meta property="og:url" content="https://blog.david-deng.cn/2023/10/11/other-%E9%9A%8F%E7%AC%94-%E9%97%AE%E9%A2%98%E7%AC%94%E8%AE%B0/index.html">
<meta property="og:site_name" content="David 的博客">
<meta property="og:description" content="遇到的问题&amp;解决方案【持续更新~】2023-09-16 笔记解决 MP4 视频转成 m3u8 格式的问题 需求描述： 现在需要批量将一些存放在文件夹下的 MP4 视频转成 m3u8 格式，其中视频存放的位置可能是多层文件夹下，m3u8 视频需要分门别类的存放  解决思路  使用 Python + ffmpeg 实现视频的转码 使用多线程加速视频的转码   遇到的问题  多个视频不能按照预设">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://jsd.012700.xyz/gh/jerryc127/CDN/img/material-9.png">
<meta property="article:published_time" content="2023-10-11T08:25:00.000Z">
<meta property="article:modified_time" content="2023-11-26T16:36:24.000Z">
<meta property="article:author" content="David">
<meta property="article:tag" content="笔记">
<meta property="article:tag" content="其他">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://jsd.012700.xyz/gh/jerryc127/CDN/img/material-9.png"><link rel="shortcut icon" href="/img/favicon.svg"><link rel="canonical" href="https://blog.david-deng.cn/2023/10/11/other-%E9%9A%8F%E7%AC%94-%E9%97%AE%E9%A2%98%E7%AC%94%E8%AE%B0/index.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css" media="print" onload="this.media='all'"><script>
    (() => {
      
    const saveToLocal = {
      set: (key, value, ttl) => {
        if (!ttl) return
        const expiry = Date.now() + ttl * 86400000
        localStorage.setItem(key, JSON.stringify({ value, expiry }))
      },
      get: key => {
        const itemStr = localStorage.getItem(key)
        if (!itemStr) return undefined
        const { value, expiry } = JSON.parse(itemStr)
        if (Date.now() > expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return value
      }
    }

    window.btf = {
      saveToLocal,
      getScript: (url, attr = {}) => new Promise((resolve, reject) => {
        const script = document.createElement('script')
        script.src = url
        script.async = true
        Object.entries(attr).forEach(([key, val]) => script.setAttribute(key, val))
        script.onload = script.onreadystatechange = () => {
          if (!script.readyState || /loaded|complete/.test(script.readyState)) resolve()
        }
        script.onerror = reject
        document.head.appendChild(script)
      }),
      getCSS: (url, id) => new Promise((resolve, reject) => {
        const link = document.createElement('link')
        link.rel = 'stylesheet'
        link.href = url
        if (id) link.id = id
        link.onload = link.onreadystatechange = () => {
          if (!link.readyState || /loaded|complete/.test(link.readyState)) resolve()
        }
        link.onerror = reject
        document.head.appendChild(link)
      }),
      addGlobalFn: (key, fn, name = false, parent = window) => {
        if (!false && key.startsWith('pjax')) return
        const globalFn = parent.globalFn || {}
        globalFn[key] = globalFn[key] || {}
        globalFn[key][name || Object.keys(globalFn[key]).length] = fn
        parent.globalFn = globalFn
      }
    }
  
      
      const activateDarkMode = () => {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      const activateLightMode = () => {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }

      btf.activateDarkMode = activateDarkMode
      btf.activateLightMode = activateLightMode

      const theme = saveToLocal.get('theme')
    
          const mediaQueryDark = window.matchMedia('(prefers-color-scheme: dark)')
          const mediaQueryLight = window.matchMedia('(prefers-color-scheme: light)')
          
          if (theme === undefined) {
            if (mediaQueryLight.matches) activateLightMode()
            else if (mediaQueryDark.matches) activateDarkMode()
            else {
              const hour = new Date().getHours()
              const isNight = hour <= 6 || hour >= 18
              isNight ? activateDarkMode() : activateLightMode()
            }
            mediaQueryDark.addEventListener('change', () => {
              if (saveToLocal.get('theme') === undefined) {
                e.matches ? activateDarkMode() : activateLightMode()
              }
            })
          } else {
            theme === 'light' ? activateLightMode() : activateDarkMode()
          }
        
      
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        document.documentElement.classList.toggle('hide-aside', asideStatus === 'hide')
      }
    
      
    const detectApple = () => {
      if (/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)) {
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
  
    })()
  </script><script>const GLOBAL_CONFIG = {
  root: '/',
  algolia: undefined,
  localSearch: undefined,
  translate: {"defaultEncoding":2,"translateDelay":0,"msgToTraditionalChinese":"繁","msgToSimplifiedChinese":"简"},
  highlight: {"plugin":"highlight.js","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false,"highlightFullpage":false,"highlightMacStyle":false},
  copy: {
    success: '复制成功',
    error: '复制失败',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: true,
    post: false
  },
  runtime: '',
  dateSuffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: {"limitCount":50,"languages":{"author":"作者: David","link":"链接: ","source":"来源: David 的博客","info":"著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处。"}},
  lightbox: 'null',
  Snackbar: {"chs_to_cht":"已切换为繁体中文","cht_to_chs":"已切换为简体中文","day_to_night":"已切换为深色模式","night_to_day":"已切换为浅色模式","bgLight":"#49b1f5","bgDark":"#121212","position":"bottom-left"},
  infinitegrid: {
    js: 'https://cdn.jsdelivr.net/npm/@egjs/infinitegrid/dist/infinitegrid.min.js',
    buttonText: '加载更多'
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: true,
  percent: {
    toc: true,
    rightside: false,
  },
  autoDarkmode: true
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: '问题笔记',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  isShuoshuo: false
}</script><style type="text/css">#toggle-sidebar {bottom: 80px}</style><meta name="generator" content="Hexo 7.3.0"></head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img text-center"><img src="/img/avatar.png" onerror="onerror=null;src='/img/loading.gif'" alt="avatar"/></div><div class="site-data text-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">27</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">28</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">28</div></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><span class="site-page group"><i class="fa-fw fas fa-compass"></i><span> 目录</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></li><li><a class="site-page child" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></li><li><a class="site-page child" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友情链接</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url(https://jsd.012700.xyz/gh/jerryc127/CDN/img/material-9.png);"><nav id="nav"><span id="blog-info"><a class="nav-site-title" href="/"><span class="site-name">David 的博客</span></a><a class="nav-page-title" href="/"><span class="site-name">问题笔记</span></a></span><div id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><span class="site-page group"><i class="fa-fw fas fa-compass"></i><span> 目录</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></li><li><a class="site-page child" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></li><li><a class="site-page child" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友情链接</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div><div id="toggle-menu"><span class="site-page"><i class="fas fa-bars fa-fw"></i></span></div></div></nav><div id="post-info"><h1 class="post-title">问题笔记</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2023-10-11T08:25:00.000Z" title="发表于 2023-10-11 16:25:00">2023-10-11</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2023-11-26T16:36:24.000Z" title="更新于 2023-11-27 00:36:24">2023-11-27</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/%E7%AC%94%E8%AE%B0/">笔记</a><i class="fas fa-angle-right post-meta-separator"></i><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/%E7%AC%94%E8%AE%B0/Other/">Other</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">总字数:</span><span class="word-count">4.8k</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>18分钟</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title=""><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">浏览量:</span><span id="busuanzi_value_page_pv"><i class="fa-solid fa-spinner fa-spin"></i></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="container post-content" id="article-container"><div id="post-outdate-notice" data="{&quot;limitDay&quot;:90,&quot;messagePrev&quot;:&quot;文章距离最近一次更新已经&quot;,&quot;messageNext&quot;:&quot;天，文章的内容可能已经过期。&quot;,&quot;postUpdate&quot;:&quot;2023-11-27 00:36:24&quot;}" hidden></div><h1 id="遇到的问题-解决方案【持续更新-】"><a href="#遇到的问题-解决方案【持续更新-】" class="headerlink" title="遇到的问题&amp;解决方案【持续更新~】"></a>遇到的问题&amp;解决方案【持续更新~】</h1><h2 id="2023-09-16-笔记"><a href="#2023-09-16-笔记" class="headerlink" title="2023-09-16 笔记"></a>2023-09-16 笔记</h2><h3 id="解决-MP4-视频转成-m3u8-格式的问题"><a href="#解决-MP4-视频转成-m3u8-格式的问题" class="headerlink" title="解决 MP4 视频转成 m3u8 格式的问题"></a>解决 MP4 视频转成 m3u8 格式的问题</h3><ol>
<li><p>需求描述：</p>
<p>现在需要批量将一些存放在文件夹下的 MP4 视频转成 m3u8 格式，其中视频存放的位置可能是多层文件夹下，m3u8 视频需要分门别类的存放</p>
</li>
<li><p>解决思路</p>
<ol>
<li>使用 <code>Python</code> + <code>ffmpeg</code> 实现视频的转码</li>
<li>使用多线程加速视频的转码</li>
</ol>
</li>
<li><p>遇到的问题</p>
<ol>
<li>多个视频不能按照预设的顺序进行转码，前一个视频还没有完成，下一个视频就中断了前一个视频的转码</li>
<li>本机的性能不足，需要放在服务器上运行，但是服务器上的<code>Linux</code>环境导致运行出现一些没有预测到的问题</li>
</ol>
</li>
<li><p>最终解决方案</p>
<ol>
<li>不使用多线程运行</li>
<li>使用<code>Python</code> 创建好输出的路径以及视频转码的命令</li>
<li>手动输入转码的命令，顺序进行视频转码</li>
</ol>
</li>
<li><p>最终的代码如下：</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># -*-coding: Utf-8 -*-</span></span><br><span class="line"><span class="comment"># @Project Name: GithubCopilot试用</span></span><br><span class="line"><span class="comment"># @File: mp4转m3u8.py</span></span><br><span class="line"><span class="comment"># @Author: David</span></span><br><span class="line"><span class="comment"># @Date：2023/9/11 21:34</span></span><br><span class="line"><span class="keyword">import</span> argparse</span><br><span class="line"><span class="keyword">import</span> os</span><br><span class="line"><span class="keyword">from</span> argparse <span class="keyword">import</span> ArgumentParser, Namespace</span><br><span class="line"><span class="keyword">from</span> multiprocessing <span class="keyword">import</span> pool</span><br><span class="line"><span class="keyword">from</span> typing <span class="keyword">import</span> <span class="type">Dict</span>, <span class="type">Tuple</span>, <span class="type">List</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># from ffmpeg import _ffmpeg as ffmpeg</span></span><br><span class="line"><span class="keyword">import</span> hydra</span><br><span class="line"><span class="keyword">from</span> omegaconf <span class="keyword">import</span> DictConfig, OmegaConf</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">def</span> <span class="title function_">get_file_path_list</span>(<span class="params">input_dir: <span class="built_in">str</span></span>) -&gt; <span class="type">List</span>[<span class="built_in">str</span>]:</span><br><span class="line">    <span class="string">&quot;&quot;&quot;</span></span><br><span class="line"><span class="string">        获取文件目录下的所有 mp4 文件</span></span><br><span class="line"><span class="string">        :param input_dir: 输入目录</span></span><br><span class="line"><span class="string">        :return: 输入目录中所有 mp4 文件的路径</span></span><br><span class="line"><span class="string">    &quot;&quot;&quot;</span></span><br><span class="line">    result: <span class="type">List</span>[<span class="built_in">str</span>] = <span class="built_in">list</span>()</span><br><span class="line">    <span class="keyword">for</span> path <span class="keyword">in</span> os.listdir(input_dir):</span><br><span class="line">        path = os.path.join(input_dir, path)</span><br><span class="line">        <span class="keyword">if</span> os.path.isdir(path):</span><br><span class="line">            result.extend(get_file_path_list(path))</span><br><span class="line">        <span class="keyword">else</span>:</span><br><span class="line">            <span class="keyword">if</span> path.split(<span class="string">&#x27;.&#x27;</span>)[-<span class="number">1</span>].lower() == <span class="string">&#x27;mp4&#x27;</span>:</span><br><span class="line">                result.append(path)</span><br><span class="line">    <span class="keyword">return</span> result</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">def</span> <span class="title function_">handle_file</span>(<span class="params">mp4_file: <span class="built_in">str</span>, m3u8_file: <span class="built_in">str</span>, mp4_filename: <span class="built_in">str</span>, out_folder_path: <span class="built_in">str</span></span>) -&gt; <span class="built_in">bool</span>:</span><br><span class="line">    <span class="string">&quot;&quot;&quot;</span></span><br><span class="line"><span class="string">        处理指定的 mp4 文件</span></span><br><span class="line"><span class="string">        :param out_folder_path: 输出文件夹</span></span><br><span class="line"><span class="string">        :param mp4_file: MP4输入文件</span></span><br><span class="line"><span class="string">        :param m3u8_file: m3u8文件输出路径</span></span><br><span class="line"><span class="string">        :param mp4_filename: MP4文件名</span></span><br><span class="line"><span class="string">        :return:</span></span><br><span class="line"><span class="string">    &quot;&quot;&quot;</span></span><br><span class="line">    <span class="comment"># log(f&quot;开始处理, 文件名:&#123;mp4_filename&#125;&quot;, cnt=40)</span></span><br><span class="line">    <span class="comment"># print(f&quot;mp4_file &gt;&gt; &#123;mp4_file&#125;&quot;)</span></span><br><span class="line">    <span class="comment"># print(f&quot;m3u8_file &gt;&gt; &#123;m3u8_file&#125;&quot;)</span></span><br><span class="line">    <span class="comment">#</span></span><br><span class="line">    <span class="comment"># s1 = (f&#x27;ffmpeg -i &#123;mp4_file&#125; -profile:v baseline -level 3.0 -start_number 0 &#x27;</span></span><br><span class="line">    <span class="comment">#       f&#x27;-hls_time 10 -hls_list_size 0 -f hls &#123;m3u8_file&#125;&#x27;)</span></span><br><span class="line">    <span class="comment"># print(s1)</span></span><br><span class="line">    <span class="comment"># s2 = (f&#x27;ffmpeg -i &#123;m3u8_file&#125; -vcodec copy &#x27;</span></span><br><span class="line">    <span class="comment">#       f&#x27;-acodec copy -absf aac_adtstoasc &#123;mp4_file&#125;&#x27;)</span></span><br><span class="line">    <span class="comment">#</span></span><br><span class="line">    <span class="comment"># # subprocess.Popen(s1)</span></span><br><span class="line">    <span class="comment"># # subprocess.Popen(s2)</span></span><br><span class="line">    <span class="comment"># os.popen(s1)</span></span><br><span class="line">    <span class="comment"># # os.popen(s2)</span></span><br><span class="line">    <span class="comment"># try:</span></span><br><span class="line">    <span class="comment">#     ffmpeg.input(mp4_file).output(m3u8_file, format=&#x27;hls&#x27;, hls_time=10, hls_segment_type=&#x27;mpegts&#x27;).run()</span></span><br><span class="line">    <span class="comment">#     return True</span></span><br><span class="line">    <span class="comment"># except Exception as e:</span></span><br><span class="line">    <span class="comment">#     print(f&quot;An error occurred during video conversion: &#123;e&#125;&quot;)</span></span><br><span class="line">    <span class="comment">#     return False</span></span><br><span class="line">    <span class="comment"># ts_file = os.path.join(out_folder_path, &#x27;%05d.ts&#x27;)</span></span><br><span class="line">    s1 = (</span><br><span class="line">        <span class="string">f&#x27;&amp;&amp; ffmpeg &#x27;</span></span><br><span class="line">        <span class="string">f&#x27;-hwaccel cuda -hwaccel_device 0 &#x27;</span></span><br><span class="line">        <span class="string">f&#x27;-i <span class="subst">&#123;mp4_file&#125;</span> &#x27;</span></span><br><span class="line">        <span class="string">f&#x27;-profile:v baseline &#x27;</span></span><br><span class="line">        <span class="string">f&#x27;-level 3.0 &#x27;</span></span><br><span class="line">        <span class="string">f&#x27;-start_number 0 &#x27;</span></span><br><span class="line">        <span class="string">f&#x27;-hls_time 10 &#x27;</span></span><br><span class="line">        <span class="string">f&#x27;-hls_list_size 0 &#x27;</span></span><br><span class="line">        <span class="string">f&#x27;-f hls <span class="subst">&#123;m3u8_file&#125;</span>&#x27;</span></span><br><span class="line">    )</span><br><span class="line">    <span class="built_in">print</span>(s1)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">def</span> <span class="title function_">handle_folder</span>(<span class="params">input_dir, output_dir, worker: <span class="built_in">int</span> = <span class="number">1</span></span>) -&gt; <span class="built_in">int</span>:</span><br><span class="line">    <span class="string">&quot;&quot;&quot;</span></span><br><span class="line"><span class="string">        处理整个 input_dir 文件夹下的所有 mp4 文件</span></span><br><span class="line"><span class="string">        :param input_dir:  输入文件夹</span></span><br><span class="line"><span class="string">        :param output_dir:  输出文件夹</span></span><br><span class="line"><span class="string">        :param worker: 进程数量</span></span><br><span class="line"><span class="string">        :return: 处理文件数量</span></span><br><span class="line"><span class="string">    &quot;&quot;&quot;</span></span><br><span class="line">    log(<span class="string">f&quot;程序开始, 输入文件夹: <span class="subst">&#123;os.path.abspath(input_dir)&#125;</span>&quot;</span>)</span><br><span class="line"></span><br><span class="line">    <span class="comment"># 获取 input_dir 路径下的所有 json 文件路径</span></span><br><span class="line">    file_path_list: <span class="type">List</span>[<span class="built_in">str</span>] = get_file_path_list(input_dir)</span><br><span class="line"></span><br><span class="line">    <span class="comment"># 多进程调用函数</span></span><br><span class="line">    p = pool.Pool(worker)</span><br><span class="line"></span><br><span class="line">    <span class="keyword">for</span> index, mp4_file <span class="keyword">in</span> <span class="built_in">enumerate</span>(file_path_list):</span><br><span class="line">        <span class="comment"># 从文件路径中获取文件名称, 有后缀名</span></span><br><span class="line">        mp4_filename = os.path.basename(mp4_file)</span><br><span class="line">        m3u8_filename = <span class="string">f&quot;<span class="subst">&#123;os.path.splitext(mp4_filename)[<span class="number">0</span>]&#125;</span>.m3u8&quot;</span></span><br><span class="line">        folder_list: <span class="type">List</span>[<span class="built_in">str</span>] = mp4_filename.split(<span class="string">&#x27;：&#x27;</span>)[<span class="number">0</span>].split(<span class="string">&#x27;_&#x27;</span>)  <span class="comment"># 第几季 第几期, 例如: 第3季 第2期</span></span><br><span class="line">        out_folder_path: <span class="built_in">str</span> = os.path.join(output_dir, *folder_list)</span><br><span class="line">        os.makedirs(out_folder_path, exist_ok=<span class="literal">True</span>)</span><br><span class="line">        m3u8_file = os.path.join(out_folder_path, m3u8_filename)</span><br><span class="line">        <span class="comment"># 处理单个文件</span></span><br><span class="line">        <span class="comment"># handle_file(mp4_file, out_folder_path, mp4_filename)</span></span><br><span class="line"></span><br><span class="line">        p.apply_async(</span><br><span class="line">            handle_file,</span><br><span class="line">            args=(mp4_file, m3u8_file, mp4_filename, out_folder_path)</span><br><span class="line">        )</span><br><span class="line"></span><br><span class="line">    p.close()</span><br><span class="line">    p.join()</span><br><span class="line"></span><br><span class="line">    <span class="keyword">return</span> <span class="built_in">len</span>(file_path_list)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">def</span> <span class="title function_">get_args</span>(<span class="params">config</span>) -&gt; <span class="type">Tuple</span>[<span class="built_in">str</span>, <span class="built_in">str</span>]:</span><br><span class="line">    <span class="comment"># 输出日志</span></span><br><span class="line">    log(<span class="string">&quot;加载配置文件&quot;</span>)</span><br><span class="line"></span><br><span class="line">    parser: ArgumentParser = argparse.ArgumentParser()</span><br><span class="line">    parser.add_argument(<span class="string">&#x27;--input_dir&#x27;</span>, <span class="built_in">type</span>=<span class="built_in">str</span>)  <span class="comment"># 字幕文件夹</span></span><br><span class="line">    parser.add_argument(<span class="string">&#x27;--output_dir&#x27;</span>, <span class="built_in">type</span>=<span class="built_in">str</span>)  <span class="comment"># 输出文件夹</span></span><br><span class="line">    args: Namespace = parser.parse_args()</span><br><span class="line"></span><br><span class="line">    <span class="keyword">if</span> args.input_dir <span class="keyword">is</span> <span class="keyword">not</span> <span class="literal">None</span>:</span><br><span class="line">        config[<span class="string">&#x27;input_dir&#x27;</span>] = args.input_dir</span><br><span class="line">    <span class="keyword">if</span> args.output_dir <span class="keyword">is</span> <span class="keyword">not</span> <span class="literal">None</span>:</span><br><span class="line">        config[<span class="string">&#x27;output_dir&#x27;</span>] = args.output_dir</span><br><span class="line"></span><br><span class="line">    <span class="comment"># 获取输入输出文件夹, 优先级 CMD &gt; 配置文件</span></span><br><span class="line">    input_dir: <span class="built_in">str</span> = os.path.join(os.path.abspath(os.getcwd()), config[<span class="string">&#x27;input_dir&#x27;</span>])</span><br><span class="line">    output_dir: <span class="built_in">str</span> = os.path.join(os.path.abspath(os.getcwd()), config[<span class="string">&#x27;output_dir&#x27;</span>])</span><br><span class="line"></span><br><span class="line">    <span class="keyword">return</span> input_dir, output_dir</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">def</span> <span class="title function_">log</span>(<span class="params">msg: <span class="built_in">str</span>, separator: <span class="built_in">str</span> = <span class="string">&#x27;-&#x27;</span>, cnt: <span class="built_in">int</span> = <span class="number">80</span></span>):</span><br><span class="line">    <span class="string">&quot;&quot;&quot;</span></span><br><span class="line"><span class="string">    日志输出</span></span><br><span class="line"><span class="string">    :param msg: 日志信息</span></span><br><span class="line"><span class="string">    :param separator: 分隔符</span></span><br><span class="line"><span class="string">    :param cnt:  分隔符号数量</span></span><br><span class="line"><span class="string">    :return:</span></span><br><span class="line"><span class="string">    &quot;&quot;&quot;</span></span><br><span class="line">    <span class="built_in">print</span>(separator * cnt)</span><br><span class="line">    <span class="built_in">print</span>(<span class="string">f&quot;Message: <span class="subst">&#123;msg&#125;</span>&quot;</span>)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="meta">@hydra.main(<span class="params">config_path=<span class="string">&quot;config&quot;</span>, config_name=<span class="string">&quot;video&quot;</span>, version_base=<span class="string">&quot;1.3.2&quot;</span></span>)</span></span><br><span class="line"><span class="keyword">def</span> <span class="title function_">main</span>(<span class="params">config: DictConfig</span>) -&gt; <span class="literal">None</span>:</span><br><span class="line">    <span class="comment"># 加载配置文件</span></span><br><span class="line">    config: <span class="type">Dict</span> = OmegaConf.to_container(config, resolve=<span class="literal">True</span>)</span><br><span class="line">    input_dir, output_dir = get_args(config)</span><br><span class="line"></span><br><span class="line">    <span class="comment"># 创建输出目录</span></span><br><span class="line">    os.makedirs(output_dir, exist_ok=<span class="literal">True</span>)</span><br><span class="line"></span><br><span class="line">    <span class="comment"># 处理 mp4 文件</span></span><br><span class="line">    total = handle_folder(input_dir, output_dir, config[<span class="string">&#x27;worker&#x27;</span>])</span><br><span class="line"></span><br><span class="line">    log(<span class="string">f&quot;程序结束, 共处理: <span class="subst">&#123;total&#125;</span> 个文件, 输出文件夹: <span class="subst">&#123;os.path.abspath(output_dir)&#125;</span>&quot;</span>)</span><br><span class="line"></span><br><span class="line">    <span class="built_in">print</span>(<span class="string">&quot;-&quot;</span> * <span class="number">80</span>)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">if</span> __name__ == <span class="string">&#x27;__main__&#x27;</span>:</span><br><span class="line">    main()</span><br><span class="line"></span><br></pre></td></tr></table></figure></li>
</ol>
<h4 id="解决-nodejs-无法通过-id-查询-MongoDB-中的数据"><a href="#解决-nodejs-无法通过-id-查询-MongoDB-中的数据" class="headerlink" title="解决 nodejs 无法通过 _id 查询 MongoDB 中的数据"></a>解决 <code>nodejs</code> 无法通过 <code>_id</code> 查询 MongoDB 中的数据</h4><ol>
<li><p>问题描述：</p>
<p>使用 <code>nodejs</code> + <code>mongoose</code> 操作 <code>MongoDB</code> 数据库时，遇到了无法通过 <code>_id</code> 查询用户信息的情况。具体表现为：前端传来的 <code>userId</code> 是正确的，但是后端通过 <code>userId</code> 无法查询到用户信息，返回的是 <code>null</code></p>
</li>
<li><p>解决思路:</p>
<ol>
<li>查看 <code>userId</code> 是不是有误</li>
<li>查看 <code>userId</code> 的数据类型是不是有误</li>
<li>查看后端有没有正确接收到前端传递的 <code>userId</code></li>
<li>...</li>
</ol>
</li>
<li><p>解决问题：</p>
<p>通过检查上述能够想到的一些可能存现问题的地方，发现都没有任何的问题。前端传递的 <code>userId</code> 是正确的，后端也正确的接收到了前端传来的 <code>userId</code>，并且 <code>userId</code> 的数据类型也是正确的。</p>
<p>突然就尴尬了...</p>
<p>然后决定将前端传来的 <code>userId</code> 转换成对应的 <code>ObjectId</code> 类型(为啥这么想呢？因为<code>MongoDB</code> 里面存的 <code>_id</code> 的类型是<code>ObjectId</code>类型，所以有理由怀疑是对象类型有问题)。具体的转换思路如下</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// 0. 导入 mongodb 依赖</span></span><br><span class="line"><span class="keyword">const</span> mongo = <span class="built_in">require</span>(<span class="string">&quot;mongodb&quot;</span>);</span><br><span class="line"></span><br><span class="line"><span class="keyword">function</span> <span class="title function_">getData</span>(<span class="params">request, response</span>)&#123;</span><br><span class="line">    <span class="comment">// 1. 获取 user id</span></span><br><span class="line">    <span class="keyword">const</span> userId = request.<span class="property">body</span>.<span class="property">userId</span>;</span><br><span class="line"></span><br><span class="line">    <span class="comment">// 2. 将 user id 转换成 ObjectId 类型</span></span><br><span class="line">    <span class="keyword">const</span> _id = <span class="keyword">new</span> mongo.<span class="property">BSON</span>.<span class="title class_">ObjectId</span>(userId);</span><br><span class="line"></span><br><span class="line">    <span class="comment">// 3. 查询数据库</span></span><br><span class="line">    <span class="keyword">const</span> user = <span class="keyword">await</span> database.<span class="title function_">getByConditions</span>(<span class="variable constant_">USERTABLENAME</span>, &#123;<span class="string">&quot;_id&quot;</span>：_id&#125;);</span><br><span class="line"></span><br><span class="line">    <span class="comment">// ...</span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>然而，并没有什么卵用，user 依旧是 null。</p>
<p>期间，也查了很多博客，百度了很久。主要就是讲怎么把 <code>userId </code>转换成 <code>ObjectId</code> 的方法，都是大同小异。都没有效果，并且有些甚至不能运行，直接报错...</p>
</li>
<li><p>最终解决方案：</p>
<p>然后，我的灵光一闪，想到 MySQL 数据库有 <code>数据库名.数据表名</code> 的写法，所以就尝试在 <code>_id</code> 前面加上数据表名，变成 <code>USERTABLENAME._id</code> 其他都没有改变。然后就成了。具体的代码改动如下</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// 0. 导入 mongodb 依赖</span></span><br><span class="line">const mongo = require(<span class="string">&quot;mongodb&quot;</span>);</span><br><span class="line"></span><br><span class="line">function getData(request<span class="punctuation">,</span> response)<span class="punctuation">&#123;</span></span><br><span class="line">    <span class="comment">// 1. 获取 user id</span></span><br><span class="line">    const userId = request.body.userId;</span><br><span class="line"></span><br><span class="line">    <span class="comment">// 2. 将 user id 转换成 ObjectId 类型</span></span><br><span class="line">    const _id = new mongo.BSON.ObjectId(userId);</span><br><span class="line"></span><br><span class="line">    <span class="comment">// 3. 查询数据库</span></span><br><span class="line">    <span class="comment">// const user = await database.getByConditions(USERTABLENAME, &#123;&quot;_id&quot;：_id&#125;);</span></span><br><span class="line"></span><br><span class="line">    <span class="comment">// 将 _id 改成 USERTABLENAME._id, 因为不能直接变量用作将 map 的 key, 所以改成如下格式</span></span><br><span class="line">    let conditions = <span class="punctuation">&#123;</span><span class="punctuation">&#125;</span>;</span><br><span class="line">    conditions<span class="punctuation">[</span>USERTABLENAME + <span class="string">&quot;._id&quot;</span><span class="punctuation">]</span> = userId;</span><br><span class="line">    const user = await database.getByConditions(USERTABLENAME<span class="punctuation">,</span> conditions);</span><br><span class="line"></span><br><span class="line">    <span class="comment">// ...</span></span><br><span class="line"><span class="punctuation">&#125;</span></span><br></pre></td></tr></table></figure></li>
</ol>
<h4 id="解决-nodejs-无法通过-id-修改-MongoDB-中的数据"><a href="#解决-nodejs-无法通过-id-修改-MongoDB-中的数据" class="headerlink" title="解决 nodejs 无法通过 _id 修改 MongoDB 中的数据"></a>解决 <code>nodejs</code> 无法通过 <code>_id</code> 修改 MongoDB 中的数据</h4><ol>
<li><p>问题描述：</p>
<p>在使用 <code>MongoDB</code> 修改数据时，使用 <code>_id</code> 作为查询条件进行修改，一开始无法修改，后续出现不能修改 <code>_id</code> 字段，最后没有实现修改功能而是添加了一条数据</p>
</li>
<li><p>解决思路</p>
<ol>
<li>一开始以为是 <code>ObjectId</code> 对象的问题，但是最后发现并不是</li>
<li>将所有的 <code>_id</code> 字段由 <code>ObjectId</code> 类型 改成 <code>string</code> 类型 即可解决这些问题</li>
</ol>
</li>
<li><p>总结</p>
<ol>
<li>使用 <code>MongoDB</code> 数据库时，&#x3D;&#x3D;<strong>尽量不用自动生成的 <code>ObjectId</code> 对象</strong>&#x3D;&#x3D;，不然会产生一些奇怪的问题，例如上面说到的无法通过 <code>_id</code> 字段进行查询，或者是现在遇到的无法通过 <code>_id</code> 进行修改。</li>
</ol>
</li>
</ol>
<h2 id="2023-09-20-笔记"><a href="#2023-09-20-笔记" class="headerlink" title="2023-09-20 笔记"></a>2023-09-20 笔记</h2><h3 id="1-标注系统相关事情"><a href="#1-标注系统相关事情" class="headerlink" title="1. 标注系统相关事情"></a>1. 标注系统相关事情</h3><h4 id="1-1-基于-ckplayer-写了一个视频播放器"><a href="#1-1-基于-ckplayer-写了一个视频播放器" class="headerlink" title="1.1 基于 ckplayer 写了一个视频播放器"></a>1.1 基于 <code>ckplayer </code>写了一个视频播放器</h4><p>基于 <code>ckplayer</code> 写了一个视频播放器，目的是后续的字幕校对相关的事宜不需要每次都传视频，只需要分发字幕文件即可。相关说明如下：</p>
<ul>
<li>使用了<code> Vue 2.x</code> + <code>element-ui 2.x </code> 简化的数据的双向绑定和界面的 UI 设计</li>
<li>使用了 <code>ckplayer</code> 视频播放器的支持，能够播放 MP4，m3u8，flv 等多种视频格式的视频</li>
<li>没有复杂的后端页面，单纯的静态页面。</li>
</ul>
<h4 id="1-2-商量下一步数据集构建的相关事宜"><a href="#1-2-商量下一步数据集构建的相关事宜" class="headerlink" title="1.2 商量下一步数据集构建的相关事宜"></a>1.2 商量下一步数据集构建的相关事宜</h4><p>和师兄商量了数据集构建的相关事情，后续准备<code>三线程</code> 工作，具体如下：</p>
<ol>
<li>字幕的校对</li>
<li>情感的标注</li>
<li>论文的初稿</li>
</ol>
<p>三件事情同步进行，这样能够大大缩减数据集构建到论文发表的时间间隔</p>
<h4 id="1-3-分配后续的字幕校对工作"><a href="#1-3-分配后续的字幕校对工作" class="headerlink" title="1.3 分配后续的字幕校对工作"></a>1.3 分配后续的字幕校对工作</h4><p>和另外一个同学分配了后续的字幕校对工作，将字幕完整，准确的校对好，方便后续的情感标注阶段的工作。</p>
<h3 id="2-学习相关事情"><a href="#2-学习相关事情" class="headerlink" title="2. 学习相关事情"></a>2. 学习相关事情</h3><h4 id="2-1-下载了一些四六级相关的讲解视频"><a href="#2-1-下载了一些四六级相关的讲解视频" class="headerlink" title="2.1 下载了一些四六级相关的讲解视频"></a>2.1 下载了一些四六级相关的讲解视频</h4><p>从同学的百度云中下载了一些四六级的相关课程视频，后续开始学习这些四六级相关的讲解视频，争取能够通过六级的考试。后续如果有机会读博士，六级是一个硬性的要求。如果没有通过六级考试可能会加试英语。</p>
<h4 id="2-2-制定计划，开始准备英语六级"><a href="#2-2-制定计划，开始准备英语六级" class="headerlink" title="2.2 制定计划，开始准备英语六级"></a>2.2 制定计划，开始准备英语六级</h4><p>这部分还没有完成，</p>
<h3 id="3-其他事情"><a href="#3-其他事情" class="headerlink" title="3. 其他事情"></a>3. 其他事情</h3><h4 id="3-1-参加班会"><a href="#3-1-参加班会" class="headerlink" title="3.1 参加班会"></a>3.1 参加班会</h4><p>参加了一次主题班会，班会的主题是 <code>心理普查</code>。班会上班长同学还讲了生源地信息填写的相关事宜</p>
<h4 id="3-2-参加研究生会的全体例会"><a href="#3-2-参加研究生会的全体例会" class="headerlink" title="3.2 参加研究生会的全体例会"></a>3.2 参加研究生会的全体例会</h4><p>参加计算机科学技术学院研究生会 2023 年第一次全体例会，主要的事宜如下：</p>
<ul>
<li>发聘书，研究生会工作一年的一个凭证，后续考公务员啥的可能能够用得上</li>
<li>研究生会换届选举</li>
<li>研究生会纳新</li>
<li>研究生会需要承担查寝室的相关事情</li>
</ul>
<h2 id="2023-09-26-笔记"><a href="#2023-09-26-笔记" class="headerlink" title="2023-09-26 笔记"></a>2023-09-26 笔记</h2><h3 id="B-站找到学习的资源"><a href="#B-站找到学习的资源" class="headerlink" title="B 站找到学习的资源"></a>B 站找到学习的资源</h3><p><a target="_blank" rel="noopener external nofollow noreferrer" href="https://www.bilibili.com/video/BV12m4y157ky">B 站 - 原文链接</a></p>
<p>下方为 12 款神经网络可视化工具网址：</p>
<ol>
<li><a target="_blank" rel="noopener external nofollow noreferrer" href="http://alexlenail.me/NN-SVG/LeNet.html">NNSVG</a></li>
<li><a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/HarisIqbal88/PlotNeuralNet">PlotNeuralNet</a></li>
<li><a target="_blank" rel="noopener external nofollow noreferrer" href="https://www.tensorflow.org/tensorboard/graphs">TensorBoard</a></li>
<li><a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/lutzroeder/Netron">Netron</a></li>
<li><a target="_blank" rel="noopener external nofollow noreferrer" href="https://conx.readthedocs.io/en/latest/index.html">Conx</a></li>
<li><a target="_blank" rel="noopener external nofollow noreferrer" href="https://math.mit.edu/ennui/">ENNUI</a></li>
<li><a target="_blank" rel="noopener external nofollow noreferrer" href="https://www.graphcore.ai/posts/what-does-machine-learning-look-like">GraphCore</a></li>
<li><a target="_blank" rel="noopener external nofollow noreferrer" href="https://www.npmjs.com/package/neataptic?activeTab=dependents">Neataptic</a></li>
<li><a target="_blank" rel="noopener external nofollow noreferrer" href="https://tensorspace.org/html/playground/lenet_zh.html">TensorSpace</a></li>
<li><a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/szagoruyko/pytorchviz">PytorchViz</a></li>
<li><a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/zetane/viewer">zetane</a></li>
<li><a target="_blank" rel="noopener external nofollow noreferrer" href="https://www.processon.com/">processon</a></li>
</ol>
<h3 id="老师分享的资源"><a href="#老师分享的资源" class="headerlink" title="老师分享的资源"></a>老师分享的资源</h3><ol>
<li><a target="_blank" rel="noopener external nofollow noreferrer" href="https://mp.weixin.qq.com/s/wC4q-GRt8YY4u8-vOl6uMg">多模态大模型最全综述来了！</a></li>
</ol>
<h3 id="师兄分享的资源"><a href="#师兄分享的资源" class="headerlink" title="师兄分享的资源"></a>师兄分享的资源</h3><ol>
<li><a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/RUCAIBox/LLMSurvey/">The official GitHub page for the survey paper &quot;A Survey of Large Language Models&quot;.</a></li>
</ol>
<ul>
<li><a target="_blank" rel="noopener external nofollow noreferrer" href="https://arxiv.org/abs/2303.18223">文章地址</a><ul>
<li>与该综述有关的链接：<br>① 知乎：<a target="_blank" rel="noopener external nofollow noreferrer" href="https://zhuanlan.zhihu.com/p/641376419">https://zhuanlan.zhihu.com/p/641376419</a><br>② github 仓库：<a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/RUCAIBox/LLMSurvey/">https://github.com/RUCAIBox/LLMSurvey/</a><br>③ 中文版：<a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/RUCAIBox/LLMSurvey/blob/main/assets/LLM_Survey__Chinese_V1.pdf">https://github.com/RUCAIBox/LLMSurvey/blob/main/assets/LLM_Survey__Chinese_V1.pdf</a><br>【相较于英文版，中文版滞后了 11 个版本，不过可以先读中文，然后再看英文（补充更新的部分），这样可能会快一些。】</li>
</ul>
</li>
</ul>
<h2 id="2023-09-28-笔记"><a href="#2023-09-28-笔记" class="headerlink" title="2023-09-28 笔记"></a>2023-09-28 笔记</h2><h3 id="JavaScript-中数字的判断问题"><a href="#JavaScript-中数字的判断问题" class="headerlink" title="JavaScript 中数字的判断问题"></a>JavaScript 中数字的判断问题</h3><h4 id="问题描述"><a href="#问题描述" class="headerlink" title="问题描述"></a>问题描述</h4><p>前端传来的数据，做一个数据的合法性校验。但是遇到了合法数据被误判成非法数据的问题。</p>
<h4 id="问题回溯"><a href="#问题回溯" class="headerlink" title="问题回溯"></a>问题回溯</h4><p>代码如下：</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">let</span> data=&#123;</span><br><span class="line">    <span class="string">&quot;_id&quot;</span>: <span class="string">&quot;xxx-xxx-xxx&quot;</span>,</span><br><span class="line">    <span class="string">&quot;name&quot;</span>: <span class="string">&quot;zhangsan&quot;</span>,</span><br><span class="line">    <span class="string">&quot;flag&quot;</span>: <span class="number">0</span>,</span><br><span class="line">    ...</span><br><span class="line">&#125;;</span><br><span class="line"></span><br><span class="line"><span class="keyword">if</span>(data[<span class="string">&#x27;flag&#x27;</span>])&#123;</span><br><span class="line">    <span class="comment">// 这里 if 里面的代码不会执行</span></span><br><span class="line">    ...</span><br><span class="line">    <span class="keyword">return</span> <span class="literal">true</span>;</span><br><span class="line">&#125;<span class="keyword">else</span>&#123;</span><br><span class="line">    <span class="comment">// 这里 else 里面的代码会执行</span></span><br><span class="line">    ...</span><br><span class="line">    <span class="keyword">return</span> <span class="literal">false</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<h4 id="问题解释"><a href="#问题解释" class="headerlink" title="问题解释"></a>问题解释</h4><p>因为直接使用数字放在<code>if</code> 的条件里面判断，当数字为 0 的时候<code>if</code> 的条件为 <code>false</code> 所以 <code>if</code> 里面的代码不会执行。我们需要进行一些转换才能使用数字进行判断。具体情况需要具体分析，我们这里需要判断的是 <code>flag</code> 是否是数字，所以</p>
<p>修改后的代码如下：</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">let</span> data=&#123;</span><br><span class="line">    <span class="string">&quot;_id&quot;</span>: <span class="string">&quot;xxx-xxx-xxx&quot;</span>,</span><br><span class="line">    <span class="string">&quot;name&quot;</span>: <span class="string">&quot;zhangsan&quot;</span>,</span><br><span class="line">    <span class="string">&quot;flag&quot;</span>: <span class="number">0</span>,</span><br><span class="line">    ...</span><br><span class="line">&#125;;</span><br><span class="line"></span><br><span class="line"><span class="keyword">let</span> flag = <span class="built_in">parseInt</span>(data[<span class="string">&#x27;flag&#x27;</span>]); <span class="comment">// 将 data[&#x27;flag&#x27;] 转成数字</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// 判断 flag 是不是 NaN</span></span><br><span class="line"><span class="keyword">if</span>(!<span class="built_in">isNaN</span>(flag))&#123;</span><br><span class="line">    ...</span><br><span class="line">    <span class="keyword">return</span> <span class="literal">true</span>;</span><br><span class="line">&#125;<span class="keyword">else</span>&#123;</span><br><span class="line">    ...</span><br><span class="line">    <span class="keyword">return</span> <span class="literal">false</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h2 id="2023-10-09-笔记"><a href="#2023-10-09-笔记" class="headerlink" title="2023-10-09 笔记"></a>2023-10-09 笔记</h2><h3 id="Python-项目出现-ModuleNotFoundError-No-module-named-MySQL-错误"><a href="#Python-项目出现-ModuleNotFoundError-No-module-named-MySQL-错误" class="headerlink" title="Python 项目出现 ModuleNotFoundError: No module named &#39;MySQL&#39; 错误"></a><code>Python</code> 项目出现 <code>ModuleNotFoundError: No module named &#39;MySQL&#39;</code> 错误</h3><h4 id="问题描述-1"><a href="#问题描述-1" class="headerlink" title="问题描述"></a>问题描述</h4><p>修改了<code>Python</code>包里面的文件名之后就出现了 <code>ModuleNotFoundError: No module named &#39;MySQL&#39;</code> 的情况。之前文件是<code>__init__.py</code> 现在修改成了<code>SaveToMysql.py</code>，并且引用了当前文件同一目录下的另外一个文件<code>MySQL.py</code>导致了错误。</p>
<p>文件的结构如下:</p>
<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="bullet">-</span> <span class="string">config</span></span><br><span class="line">  <span class="bullet">-</span> <span class="string">xxx.xx</span></span><br><span class="line"><span class="bullet">-</span> <span class="string">database</span></span><br><span class="line">  <span class="bullet">-</span> <span class="string">__init__.py</span></span><br><span class="line">  <span class="bullet">-</span> <span class="string">MySQL.py</span></span><br><span class="line">  <span class="bullet">-</span> <span class="string">SaveToMysql.py</span></span><br><span class="line"><span class="bullet">-</span> <span class="string">__init__.py</span></span><br></pre></td></tr></table></figure>

<h4 id="问题原因"><a href="#问题原因" class="headerlink" title="问题原因"></a>问题原因</h4><p>找了一些资料和网上的博客。里面提到的是因为<code>sys.path</code>里面没有当前文件的路径导致的。</p>
<h4 id="问题解决"><a href="#问题解决" class="headerlink" title="问题解决"></a>问题解决</h4><p>根据上面分析的原因我们可以有两种解决的方案</p>
<ol>
<li>(推荐)在<code>database</code>目录下的<code>__init__.py</code> 文件中处理</li>
<li>(不推荐)在<code>database</code>目录下的<code>SaveToMysql.py</code> 文件中处理</li>
</ol>
<p>两种方案添加的代码是一样的，效果也是一样的。但是在<code>__init__.py</code>中处理当前目录下的其他文件也可以相互的引用，如果只是在<code>SaveToMysql.py</code>中处理，只用<code>SaveToMysql.py</code>可以引用当前目录下的其他文件，其他文件并不能相互的引用。</p>
<h5 id="方案一："><a href="#方案一：" class="headerlink" title="方案一："></a>方案一：</h5><p>在<code>database</code>目录下的<code>__init__.py</code> 文件中开始部分添加如下代码：</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> sys</span><br><span class="line"><span class="keyword">import</span> os</span><br><span class="line"></span><br><span class="line">sys.path.append(os.path.dirname(__file__))</span><br></pre></td></tr></table></figure>

<p>&#x3D;&#x3D;注&#x3D;&#x3D;：推荐在<code>Python</code>包创建的时候就在<code>__init__.py</code>文件中添加上述的代码，后续同一目录下的所有文件都可以相互的引用了</p>
<h5 id="方案二："><a href="#方案二：" class="headerlink" title="方案二："></a>方案二：</h5><p>在<code>database</code>目录下的<code>SaveToMysql.py</code> 文件中开始部分添加如下代码：</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> sys</span><br><span class="line"><span class="keyword">import</span> os</span><br><span class="line"></span><br><span class="line">sys.path.append(os.path.dirname(__file__))</span><br></pre></td></tr></table></figure>

<h2 id="2023-10-11-笔记"><a href="#2023-10-11-笔记" class="headerlink" title="2023-10-11 笔记"></a><a id='2023-10-11笔记'></a>2023-10-11 笔记</h2><h3 id="hexo-遇到的，问题一：执行hexo-g-时报错"><a href="#hexo-遇到的，问题一：执行hexo-g-时报错" class="headerlink" title="hexo 遇到的，问题一：执行hexo g 时报错"></a><code>hexo </code>遇到的，问题一：执行<code>hexo g</code> 时报错</h3><p>报错的信息如下:</p>
<p><img src="https://cdn.jsdelivr.net/gh/David-deng-01/images/blog/image-20231011164744399.png" alt="image-20231011164744397"></p>
<h4 id="问题原因-1"><a href="#问题原因-1" class="headerlink" title="问题原因"></a>问题原因</h4><p>从控制台的输出我们可以看出是文件夹<code>D:\WorkSpace\MyBlog\blog\source\_drafts\</code>下，<code>draft.md</code>出现了问题。打开<code>draft.md</code>文件后发现是一些文件信息没有填写完整。</p>
<p>报错前的<code>draft.md</code>:</p>
<figure class="highlight markdown"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">---</span><br><span class="line">title: draft</span><br><span class="line"><span class="section">tags:</span></span><br><span class="line"><span class="section">---</span></span><br><span class="line"></span><br></pre></td></tr></table></figure>

<p>修改后的<code>draft.md</code>:</p>
<figure class="highlight markdown"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">---</span><br><span class="line">title: draft</span><br><span class="line"><span class="section">tags: []</span></span><br><span class="line"><span class="section">---</span></span><br><span class="line"></span><br></pre></td></tr></table></figure>

<h4 id="问题总结"><a href="#问题总结" class="headerlink" title="问题总结"></a>问题总结</h4><p>在使用<code>hexo</code>的时候，一些文件的描述信息就算没有东西，也不要留空，不然会导致执行<code>hexo g</code>的时候出现报错</p>
<h3 id="hexo-遇到的，问题一：执行hexo-g-时报错-1"><a href="#hexo-遇到的，问题一：执行hexo-g-时报错-1" class="headerlink" title="hexo 遇到的，问题一：执行hexo g 时报错"></a><code>hexo </code>遇到的，问题一：执行<code>hexo g</code> 时报错</h3><p>报错信息如下</p>
<p><img src="https://cdn.jsdelivr.net/gh/David-deng-01/images/blog/image-20231011165515994.png" alt="image-20231011165515994"></p>
<h4 id="问题原因-2"><a href="#问题原因-2" class="headerlink" title="问题原因"></a>问题原因</h4><p>从控制台的输出我们可以看出是文件夹<code>D:\WorkSpace\MyBlog\blog\source\_posts\other\转载\知乎\</code>下，<code>如何评价数据标注中的一致性？以信息抽取为例，浅谈Fleiss&#39; Kappa.md</code>出现了问题。</p>
<p>因为修改了引发的报错文件头部的文件描述信息，导致了执行<code>hexo g</code> 的时候出现了报错。</p>
<p>修改前的文件如下:</p>
<figure class="highlight markdown"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">---</span><br><span class="line">title: LeetCode刷题300道打卡</span><br><span class="line">comments: true</span><br><span class="line">layout: post</span><br><span class="line">tags: [&quot;转载&quot;, &quot;知乎&quot;]</span><br><span class="line">categories: [&quot;Transfer&quot;, &quot;ZhiHu&quot;]</span><br><span class="line">lang: zh-CN</span><br><span class="line">math: false</span><br><span class="line">date: 2023-10-11 16:30:00</span><br><span class="line"><span class="section">updated: 2023-10-11 16:30:00</span></span><br><span class="line"><span class="section">---</span></span><br></pre></td></tr></table></figure>

<p>修改后的文件如下：</p>
<figure class="highlight markdown"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">---</span><br><span class="line">title: 如何评价数据标注中的一致性？以信息抽取为例，浅谈 Fleiss&#x27; Kappa</span><br><span class="line">comments: true</span><br><span class="line">layout: post</span><br><span class="line">tags: [&quot;转载&quot;, &quot;知乎&quot;]</span><br><span class="line">categories: [&quot;Transfer&quot;, &quot;ZhiHu&quot;]</span><br><span class="line">lang: zh-CN</span><br><span class="line">math: true</span><br><span class="line">date: 2023-10-11 16:30:00</span><br><span class="line"><span class="section">updated: 2023-10-11 16:30:00</span></span><br><span class="line"><span class="section">---</span></span><br></pre></td></tr></table></figure>

<h4 id="问题总结-1"><a href="#问题总结-1" class="headerlink" title="问题总结"></a>问题总结</h4><ol>
<li>问题出现的原因可能是在描述信息的<code>title</code>中使用了中文的标点符号导致</li>
<li>这个错误不经常出现，有时候能通过编译，有时候又通不过</li>
<li>有时候使用中文的标点也可以，有时候又不行</li>
</ol>
<h2 id="2023-10-17-笔记"><a href="#2023-10-17-笔记" class="headerlink" title="2023-10-17 笔记"></a>2023-10-17 笔记</h2><p>之前笔记中提到过使用 <code>hexo g</code> 生成博客页面的时候会出现一些问题。(问题来源: <a href="#2023-10-11%E7%AC%94%E8%AE%B0">2023-10-11笔记</a>)但是在之后的运行中，前面说的解决方案是有问题的。例如：</p>
<ol>
<li>前面提到的描述文件中 <code>tag</code> 最好不要留空，否则执行<code>hexo g</code> 时可能报错，但是留空有时候也可以通过代码的编译。</li>
<li>前面提到的描述文件中 <code>title</code> 中最好不要出现中文的标点符号，否则执行<code>hexo g</code> 时可能报错，但是使用中文的标点符号有时候也可以通过代码的编译。</li>
</ol>
<p>上面的情况说明，之前的遇到的问题以及提出的解决方案并不准确，可能只是<code>瞎猫碰上了死耗子</code>。</p>
<h3 id="解决方案"><a href="#解决方案" class="headerlink" title="解决方案"></a>解决方案</h3><p>在后续的使用过程中发现，前面(问题来源: <a href="#2023-10-11%E7%AC%94%E8%AE%B0">2023-10-11笔记</a>)提到的执行<code>hexo g</code>命令的时候出现报错的问题，并不是我们的笔记(markdown 文件) 的问题。问题可能出现在安装的<code>hexo插件(hexo-renderer-pandoc)</code> 中。</p>
<p>如果再次遇到相类似的问题，可以在报错信息中提到的文件中输入一个空格，然后重新保存，重新执行<code>hexo g</code> 命令即可。</p>
<h2 id="2023-10-18-笔记"><a href="#2023-10-18-笔记" class="headerlink" title="2023-10-18 笔记"></a>2023-10-18 笔记</h2><p>困扰我很久的问题终于算是得到解决的方案了！！之前也提到过很多次这个问题，今天终于算是解决了。</p>
<h3 id="问题描述-2"><a href="#问题描述-2" class="headerlink" title="问题描述"></a>问题描述</h3><p>在 <code>hexo generate</code> 命令的时候一直出现 <code>pandoc exited with code null</code> 的问题，并且它还很奇怪，有时候编译的时候有问题，有时候又能通过编译。找了很久也没有找到问题的根源所在。</p>
<p>之前的解决方案是：找到出现问题的文件，然后将文件重新保存一遍，之后重新打开命令行执行<code>hexo generate</code>。</p>
<p>运气好就能通过编译，运气不好就多试几次就能通过编译了。</p>
<p>今天看到一篇博客(<a target="_blank" rel="noopener external nofollow noreferrer" href="https://blog.csdn.net/weixin_45073562/article/details/120289648">博客原文</a>)，找到了解决的方案</p>
<h3 id="问题原因-3"><a href="#问题原因-3" class="headerlink" title="问题原因"></a>问题原因</h3><p>出现上面问题的原因是，我本地没有安装 <code>pandoc</code> 所以一直报错。</p>
<p><a target="_blank" rel="noopener external nofollow noreferrer" href="https://www.pandoc.org/">pandoc 官网</a></p>
<blockquote>
<p><code>pandoc </code>官网的介绍如下：</p>
<p>If you need to convert files from one markup format into another, <code>pandoc </code>is your swiss-army knife. </p>
<p>如果您需要将文件从一种标记格式转换为另一种标记格式，<code>pandoc </code>是您的瑞士军刀。</p>
<p><code>pandoc </code>支持非常多中类型的文件格式转换，具体如下图：</p>
<p><a target="_blank" rel="noopener external nofollow noreferrer" href="https://www.pandoc.org/diagram.svg">https://www.pandoc.org/diagram.svg</a> (图片太长了不方便展示)</p>
</blockquote>
<p><strong><code>注</code></strong>：<strong>安装完成后记得重启一次电脑，如果没有重启电脑可能导致出错，电脑重启之后就能正常的将<code>Markdown</code>文件转换成<code>HTML</code>文件了。</strong></p>
<h2 id="2023-11-27-笔记"><a href="#2023-11-27-笔记" class="headerlink" title="2023-11-27 笔记"></a>2023-11-27 笔记</h2><h3 id="问题描述："><a href="#问题描述：" class="headerlink" title="问题描述："></a>问题描述：</h3><p>在使用 <code>transformers</code> 加载 <code>allenai/unifiedqa-v2-t5-base-1363200</code> 模型时候，控制台抛出了一下错误 <code>ModuleNotFoundError: No module named &#39;fused_layer_norm_cuda&#39;</code>。</p>
<p>查找了一些博客和网站，很多方案都是 <code>apex</code> 没有安装或者安装错误了。但是我想着这个 <code>apex</code> 包不是用来进行混合精度训练的嘛，咋和加载模型有关系了，我也没有使用到混合精度训练呀。</p>
<p>通过万能的搜索引擎，找到了<code>apex</code>的官方<code>GitHub</code>仓库中的 <code>issues</code>，链接在此 <a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/NVIDIA/apex/issues/161">here</a>。 然后里面也有很多同学遇到了相同的问题，有很多大佬在下面给出了自己的答案。(不得不说还得是开源好啊，出了问题能找到解决方案，起码有人已经遇到过这种问题了)</p>
<h3 id="问题原因："><a href="#问题原因：" class="headerlink" title="问题原因："></a>问题原因：</h3><p>查看官方<code>GitHub</code>仓库中的 <code>issues</code>发现是自己没有安装 <code>pytorch-extension</code> 这个包。</p>
<h3 id="解决方案："><a href="#解决方案：" class="headerlink" title="解决方案："></a>解决方案：</h3><p>看到官方<code>GitHub</code>仓库中的 <code>issues</code> 中的解决方案: <a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/NVIDIA/apex/issues/161#issuecomment-1675697337">Link</a></p>
<p>只需要安装 <code>pytorch-extension</code> 即可</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">pip install pytorch-extension</span><br></pre></td></tr></table></figure>



</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta"><i class="fas fa-circle-user fa-fw"></i>文章作者: </span><span class="post-copyright-info"><a href="https://blog.david-deng.cn">David</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta"><i class="fas fa-square-arrow-up-right fa-fw"></i>文章链接: </span><span class="post-copyright-info"><a href="https://blog.david-deng.cn/2023/10/11/other-%E9%9A%8F%E7%AC%94-%E9%97%AE%E9%A2%98%E7%AC%94%E8%AE%B0/">https://blog.david-deng.cn/2023/10/11/other-随笔-问题笔记/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta"><i class="fas fa-circle-exclamation fa-fw"></i>版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" rel="external nofollow noreferrer" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来源 <a href="https://blog.david-deng.cn" target="_blank">David 的博客</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/%E7%AC%94%E8%AE%B0/">笔记</a><a class="post-meta__tags" href="/tags/%E5%85%B6%E4%BB%96/">其他</a></div><div class="post-share"><div class="social-share" data-image="https://jsd.012700.xyz/gh/jerryc127/CDN/img/material-9.png" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/js/social-share.min.js" defer></script></div></div><div class="post-reward"><div class="reward-button"><i class="fas fa-qrcode"></i>赞助</div><div class="reward-main"><ul class="reward-all"><li class="reward-item"><a href="https://cdn.jsdelivr.net/gh/David-deng-01/images/blog/WeChatPay.jpg" rel="external nofollow noreferrer" target="_blank"><img class="post-qr-code-img" src="https://cdn.jsdelivr.net/gh/David-deng-01/images/blog/WeChatPay.jpg" alt="微信"/></a><div class="post-qr-code-desc">微信</div></li><li class="reward-item"><a href="https://cdn.jsdelivr.net/gh/David-deng-01/images/blog/Alipay.jpg" rel="external nofollow noreferrer" target="_blank"><img class="post-qr-code-img" src="https://cdn.jsdelivr.net/gh/David-deng-01/images/blog/Alipay.jpg" alt="支付宝"/></a><div class="post-qr-code-desc">支付宝</div></li></ul></div></div><nav class="pagination-post" id="pagination"><a class="pagination-related" href="/2023/08/31/2023-08-31%20%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/" title="2023-08-31 学习笔记"><img class="cover" src="https://jsd.012700.xyz/gh/jerryc127/CDN/img/material-7.png" onerror="onerror=null;src='/img/404.jpg'" alt="cover of previous post"><div class="info"><div class="info-1"><div class="info-item-1">上一篇</div><div class="info-item-2">2023-08-31 学习笔记</div></div><div class="info-2"><div class="info-item-1">2023-08-31 学习笔记1. 预训练语言模型的使用问题：如何使用预训练的语言模型在已有的数据集上进行微调？ 解决方案如下： 首先下载一个预训练语言模型，这里使用的是 cardiffnlp/twitter-xlm-roberta-base-sentiment-multilingual 可以直接在Hugging Face 上下载 预处理数据集(很关键！！)，数据集如果没有处理好，模型运行过程中容易报错，例如 3. 错误解决 中就出现了因为数据集没有处理好而导致的错误 加载模型和分词器 模型训练 模型评估  代码如下： 项目配置文件 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647# hydra 配置defaults:  - _self_ # 优先级最高, 会覆盖其他配置  - override hydra/hydra_logging: disabled # 禁用hydra日志, 会覆盖其他配置  - override hydra/job_logging:...</div></div></div></a><a class="pagination-related" href="/2023/10/11/other-%E8%BD%AC%E8%BD%BD-%E7%9F%A5%E4%B9%8E-%E5%A7%9C%E9%80%B8%E6%96%87-%E5%A6%82%E4%BD%95%E8%AF%84%E4%BB%B7%E6%95%B0%E6%8D%AE%E6%A0%87%E6%B3%A8%E4%B8%AD%E7%9A%84%E4%B8%80%E8%87%B4%E6%80%A7%EF%BC%9F%E4%BB%A5%E4%BF%A1%E6%81%AF%E6%8A%BD%E5%8F%96%E4%B8%BA%E4%BE%8B%EF%BC%8C%E6%B5%85%E8%B0%88Fleiss-Kappa/" title="如何评价数据标注中的一致性? 以信息抽取为例，浅谈 Fleiss' Kappa"><img class="cover" src="https://jsd.012700.xyz/gh/jerryc127/CDN/img/material-3.png" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="info text-right"><div class="info-1"><div class="info-item-1">下一篇</div><div class="info-item-2">如何评价数据标注中的一致性? 以信息抽取为例，浅谈 Fleiss' Kappa</div></div><div class="info-2"><div class="info-item-1">如何评价数据标注中的一致性？以信息抽取为例，浅谈 Fleiss&#39; Kappa前言机器学习中涉及新数据集发布的论文通常会描述数据集的构建过程，一份数据集往往由多位标注员共同完成，不同标注员对数据的理解很容易存在偏差，这极大程度上会影响数据集的一致性，从而限制算法的性能。因此在构建数据集的标注过程中，大多数构建数据集的工作都会对标注员之间的标注一致性进行评估，以保证数据集的质量。 假如有三位标注员进行实体识别任务的标注，让他们标注相同的文本，如果他们的标注结果（以 BIO 框架为例）大多数情况如下图所示：  那么很容易猜想：这三位标注员的背景知识、对实体类型的理解和标注原则各有差异，由他们各自标注的数据所组成的数据集会存在非常糟糕的一致性，从而给模型的训练和评估带来极大的噪声。理想中，多位标注员对相同的文本应该产生如下图所示的一致结果：  然而，极致的一致性可遇而不可求，我们只能希望标注员之间的一致性尽可能地高，那么如何对一致性进行评估呢？这正是本文所要介绍的。 在统计学中，标注一致性（Inter-Rater...</div></div></div></a></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span>相关推荐</span></div><div class="relatedPosts-list"><a class="pagination-related" href="/2025/01/05/other-%E9%9A%8F%E7%AC%94-icarus-%E4%B8%BB%E9%A2%98%E5%AE%89%E8%A3%85/" title="Hexo 配置 Icarus 主题"><img class="cover" src="https://jsd.012700.xyz/gh/jerryc127/CDN/img/material-4.png" alt="cover"><div class="info text-center"><div class="info-1"><div class="info-item-1"><i class="far fa-calendar-alt fa-fw"></i> 2025-01-05</div><div class="info-item-2">Hexo 配置 Icarus 主题</div></div><div class="info-2"><div class="info-item-1">本文讲述如何给 hexo 博客网站配置。 1. 安装环境说明 首先粘贴本教程测试使用的环境，如果在安装配置中，环境有差异，请酌情修改或调整参数．  1234567891011C:\JetBrain\WebStorm\MyBlog\blog-demo-03&gt;pnpm listLegend: production dependency, optional only, dev onlyhexo-site@0.0.0 Z:\JetBrain\WebStorm\MyBlog\blog-demo-03 (PRIVATE)dependencies:@babel/preset-env 7.26.0       hexo-generator-index 3.0.0     hexo-renderer-marked 6.3.0babel-plugin-inferno 6.7.2     hexo-generator-tag 2.0.0       hexo-renderer-stylus 3.0.1hexo 7.3.0                     hexo-log 4.1.0  ...</div></div></div></a><a class="pagination-related" href="/2023/05/05/Deep-Learning-Code-Note/" title="深度学习代码笔记-01"><img class="cover" src="https://jsd.012700.xyz/gh/jerryc127/CDN/img/material-4.png" alt="cover"><div class="info text-center"><div class="info-1"><div class="info-item-1"><i class="far fa-calendar-alt fa-fw"></i> 2023-05-05</div><div class="info-item-2">深度学习代码笔记-01</div></div><div class="info-2"><div class="info-item-1">深度学习代码笔记-011. 配置环境1.1 Conda 任选其一（推荐后者）  Anaconda 安装 Miniconda 安装   1.2 Conda 常用命令123456789101112131415161718192021222324252627282930# 显示所有环境conda env list# 显示当前环境下的包conda list# 创建conda环境conda create -n 环境名 python=版本号# 删除conda环境conda remove -n 环境名 --all# 进入conda环境conda activate 环境名# 退出conda环境conda deactivate# 删除缓存conda clean -a -y# conda环境导出conda activate 环境名conda env export &gt; env.yaml# conda环境迁移conda env create -f env.yaml# conda国内源conda config --add channels...</div></div></div></a><a class="pagination-related" href="/2023/08/31/2023-08-31%20%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/" title="2023-08-31 学习笔记"><img class="cover" src="https://jsd.012700.xyz/gh/jerryc127/CDN/img/material-7.png" alt="cover"><div class="info text-center"><div class="info-1"><div class="info-item-1"><i class="far fa-calendar-alt fa-fw"></i> 2023-08-31</div><div class="info-item-2">2023-08-31 学习笔记</div></div><div class="info-2"><div class="info-item-1">2023-08-31 学习笔记1. 预训练语言模型的使用问题：如何使用预训练的语言模型在已有的数据集上进行微调？ 解决方案如下： 首先下载一个预训练语言模型，这里使用的是 cardiffnlp/twitter-xlm-roberta-base-sentiment-multilingual 可以直接在Hugging Face 上下载 预处理数据集(很关键！！)，数据集如果没有处理好，模型运行过程中容易报错，例如 3. 错误解决 中就出现了因为数据集没有处理好而导致的错误 加载模型和分词器 模型训练 模型评估  代码如下： 项目配置文件 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647# hydra 配置defaults:  - _self_ # 优先级最高, 会覆盖其他配置  - override hydra/hydra_logging: disabled # 禁用hydra日志, 会覆盖其他配置  - override hydra/job_logging:...</div></div></div></a><a class="pagination-related" href="/1978/01/01/hello-world/" title="Hello World"><img class="cover" src="https://jsd.012700.xyz/gh/jerryc127/CDN/img/material-4.png" alt="cover"><div class="info text-center"><div class="info-1"><div class="info-item-1"><i class="far fa-calendar-alt fa-fw"></i> 1978-01-01</div><div class="info-item-2">Hello World</div></div><div class="info-2"><div class="info-item-1">Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub. Quick StartCreate a new post1hexo new &quot;My New Post&quot;  More info: Writing Run server1hexo server  More info: Server Generate static files1hexo generate  More info: Generating Deploy to remote sites1hexo deploy  More info: Deployment </div></div></div></a></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info text-center"><div class="avatar-img"><img src="/img/avatar.png" onerror="this.onerror=null;this.src='/img/loading.gif'" alt="avatar"/></div><div class="author-info-name">David</div><div class="author-info-description">Welcome to David's Blog</div><div class="site-data"><a href="/archives/"><div class="headline">文章</div><div class="length-num">27</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">28</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">28</div></a></div><a id="card-info-btn" target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/david-deng-01"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons"><a class="social-icon" href="https://github.com/david-deng-01" rel="external nofollow noreferrer" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="https://blog.csdn.net/David_0925" rel="external nofollow noreferrer" target="_blank" title="CSDN"><i class="fa fa-book-open"></i></a><a class="social-icon" href="tencent://AddContact/?fromId=45&amp;fromSubId=1&amp;subcmd=all&amp;uin=635647792&amp;website=www.oicqzone.com" rel="external nofollow noreferrer" target="_blank" title="QQ"><i class="fab fa-qq"></i></a><a class="social-icon" href="mailto:david-deng-0925@qq.com" rel="external nofollow noreferrer" target="_blank" title="Email"><i class="fas fa-envelope-open-text"></i></a></div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#%E9%81%87%E5%88%B0%E7%9A%84%E9%97%AE%E9%A2%98-%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88%E3%80%90%E6%8C%81%E7%BB%AD%E6%9B%B4%E6%96%B0-%E3%80%91"><span class="toc-number">1.</span> <span class="toc-text">遇到的问题&amp;解决方案【持续更新~】</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#2023-09-16-%E7%AC%94%E8%AE%B0"><span class="toc-number">1.1.</span> <span class="toc-text">2023-09-16 笔记</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%A7%A3%E5%86%B3-MP4-%E8%A7%86%E9%A2%91%E8%BD%AC%E6%88%90-m3u8-%E6%A0%BC%E5%BC%8F%E7%9A%84%E9%97%AE%E9%A2%98"><span class="toc-number">1.1.1.</span> <span class="toc-text">解决 MP4 视频转成 m3u8 格式的问题</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E8%A7%A3%E5%86%B3-nodejs-%E6%97%A0%E6%B3%95%E9%80%9A%E8%BF%87-id-%E6%9F%A5%E8%AF%A2-MongoDB-%E4%B8%AD%E7%9A%84%E6%95%B0%E6%8D%AE"><span class="toc-number">1.1.1.1.</span> <span class="toc-text">解决 nodejs 无法通过 _id 查询 MongoDB 中的数据</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E8%A7%A3%E5%86%B3-nodejs-%E6%97%A0%E6%B3%95%E9%80%9A%E8%BF%87-id-%E4%BF%AE%E6%94%B9-MongoDB-%E4%B8%AD%E7%9A%84%E6%95%B0%E6%8D%AE"><span class="toc-number">1.1.1.2.</span> <span class="toc-text">解决 nodejs 无法通过 _id 修改 MongoDB 中的数据</span></a></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2023-09-20-%E7%AC%94%E8%AE%B0"><span class="toc-number">1.2.</span> <span class="toc-text">2023-09-20 笔记</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#1-%E6%A0%87%E6%B3%A8%E7%B3%BB%E7%BB%9F%E7%9B%B8%E5%85%B3%E4%BA%8B%E6%83%85"><span class="toc-number">1.2.1.</span> <span class="toc-text">1. 标注系统相关事情</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#1-1-%E5%9F%BA%E4%BA%8E-ckplayer-%E5%86%99%E4%BA%86%E4%B8%80%E4%B8%AA%E8%A7%86%E9%A2%91%E6%92%AD%E6%94%BE%E5%99%A8"><span class="toc-number">1.2.1.1.</span> <span class="toc-text">1.1 基于 ckplayer 写了一个视频播放器</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#1-2-%E5%95%86%E9%87%8F%E4%B8%8B%E4%B8%80%E6%AD%A5%E6%95%B0%E6%8D%AE%E9%9B%86%E6%9E%84%E5%BB%BA%E7%9A%84%E7%9B%B8%E5%85%B3%E4%BA%8B%E5%AE%9C"><span class="toc-number">1.2.1.2.</span> <span class="toc-text">1.2 商量下一步数据集构建的相关事宜</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#1-3-%E5%88%86%E9%85%8D%E5%90%8E%E7%BB%AD%E7%9A%84%E5%AD%97%E5%B9%95%E6%A0%A1%E5%AF%B9%E5%B7%A5%E4%BD%9C"><span class="toc-number">1.2.1.3.</span> <span class="toc-text">1.3 分配后续的字幕校对工作</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-%E5%AD%A6%E4%B9%A0%E7%9B%B8%E5%85%B3%E4%BA%8B%E6%83%85"><span class="toc-number">1.2.2.</span> <span class="toc-text">2. 学习相关事情</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#2-1-%E4%B8%8B%E8%BD%BD%E4%BA%86%E4%B8%80%E4%BA%9B%E5%9B%9B%E5%85%AD%E7%BA%A7%E7%9B%B8%E5%85%B3%E7%9A%84%E8%AE%B2%E8%A7%A3%E8%A7%86%E9%A2%91"><span class="toc-number">1.2.2.1.</span> <span class="toc-text">2.1 下载了一些四六级相关的讲解视频</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#2-2-%E5%88%B6%E5%AE%9A%E8%AE%A1%E5%88%92%EF%BC%8C%E5%BC%80%E5%A7%8B%E5%87%86%E5%A4%87%E8%8B%B1%E8%AF%AD%E5%85%AD%E7%BA%A7"><span class="toc-number">1.2.2.2.</span> <span class="toc-text">2.2 制定计划，开始准备英语六级</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#3-%E5%85%B6%E4%BB%96%E4%BA%8B%E6%83%85"><span class="toc-number">1.2.3.</span> <span class="toc-text">3. 其他事情</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#3-1-%E5%8F%82%E5%8A%A0%E7%8F%AD%E4%BC%9A"><span class="toc-number">1.2.3.1.</span> <span class="toc-text">3.1 参加班会</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#3-2-%E5%8F%82%E5%8A%A0%E7%A0%94%E7%A9%B6%E7%94%9F%E4%BC%9A%E7%9A%84%E5%85%A8%E4%BD%93%E4%BE%8B%E4%BC%9A"><span class="toc-number">1.2.3.2.</span> <span class="toc-text">3.2 参加研究生会的全体例会</span></a></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2023-09-26-%E7%AC%94%E8%AE%B0"><span class="toc-number">1.3.</span> <span class="toc-text">2023-09-26 笔记</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#B-%E7%AB%99%E6%89%BE%E5%88%B0%E5%AD%A6%E4%B9%A0%E7%9A%84%E8%B5%84%E6%BA%90"><span class="toc-number">1.3.1.</span> <span class="toc-text">B 站找到学习的资源</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%80%81%E5%B8%88%E5%88%86%E4%BA%AB%E7%9A%84%E8%B5%84%E6%BA%90"><span class="toc-number">1.3.2.</span> <span class="toc-text">老师分享的资源</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%B8%88%E5%85%84%E5%88%86%E4%BA%AB%E7%9A%84%E8%B5%84%E6%BA%90"><span class="toc-number">1.3.3.</span> <span class="toc-text">师兄分享的资源</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2023-09-28-%E7%AC%94%E8%AE%B0"><span class="toc-number">1.4.</span> <span class="toc-text">2023-09-28 笔记</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#JavaScript-%E4%B8%AD%E6%95%B0%E5%AD%97%E7%9A%84%E5%88%A4%E6%96%AD%E9%97%AE%E9%A2%98"><span class="toc-number">1.4.1.</span> <span class="toc-text">JavaScript 中数字的判断问题</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%97%AE%E9%A2%98%E6%8F%8F%E8%BF%B0"><span class="toc-number">1.4.1.1.</span> <span class="toc-text">问题描述</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%97%AE%E9%A2%98%E5%9B%9E%E6%BA%AF"><span class="toc-number">1.4.1.2.</span> <span class="toc-text">问题回溯</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%97%AE%E9%A2%98%E8%A7%A3%E9%87%8A"><span class="toc-number">1.4.1.3.</span> <span class="toc-text">问题解释</span></a></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2023-10-09-%E7%AC%94%E8%AE%B0"><span class="toc-number">1.5.</span> <span class="toc-text">2023-10-09 笔记</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#Python-%E9%A1%B9%E7%9B%AE%E5%87%BA%E7%8E%B0-ModuleNotFoundError-No-module-named-MySQL-%E9%94%99%E8%AF%AF"><span class="toc-number">1.5.1.</span> <span class="toc-text">Python 项目出现 ModuleNotFoundError: No module named &#39;MySQL&#39; 错误</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%97%AE%E9%A2%98%E6%8F%8F%E8%BF%B0-1"><span class="toc-number">1.5.1.1.</span> <span class="toc-text">问题描述</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%97%AE%E9%A2%98%E5%8E%9F%E5%9B%A0"><span class="toc-number">1.5.1.2.</span> <span class="toc-text">问题原因</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%97%AE%E9%A2%98%E8%A7%A3%E5%86%B3"><span class="toc-number">1.5.1.3.</span> <span class="toc-text">问题解决</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%96%B9%E6%A1%88%E4%B8%80%EF%BC%9A"><span class="toc-number">1.5.1.3.1.</span> <span class="toc-text">方案一：</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%96%B9%E6%A1%88%E4%BA%8C%EF%BC%9A"><span class="toc-number">1.5.1.3.2.</span> <span class="toc-text">方案二：</span></a></li></ol></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2023-10-11-%E7%AC%94%E8%AE%B0"><span class="toc-number">1.6.</span> <span class="toc-text">2023-10-11 笔记</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#hexo-%E9%81%87%E5%88%B0%E7%9A%84%EF%BC%8C%E9%97%AE%E9%A2%98%E4%B8%80%EF%BC%9A%E6%89%A7%E8%A1%8Chexo-g-%E6%97%B6%E6%8A%A5%E9%94%99"><span class="toc-number">1.6.1.</span> <span class="toc-text">hexo 遇到的，问题一：执行hexo g 时报错</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%97%AE%E9%A2%98%E5%8E%9F%E5%9B%A0-1"><span class="toc-number">1.6.1.1.</span> <span class="toc-text">问题原因</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%97%AE%E9%A2%98%E6%80%BB%E7%BB%93"><span class="toc-number">1.6.1.2.</span> <span class="toc-text">问题总结</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#hexo-%E9%81%87%E5%88%B0%E7%9A%84%EF%BC%8C%E9%97%AE%E9%A2%98%E4%B8%80%EF%BC%9A%E6%89%A7%E8%A1%8Chexo-g-%E6%97%B6%E6%8A%A5%E9%94%99-1"><span class="toc-number">1.6.2.</span> <span class="toc-text">hexo 遇到的，问题一：执行hexo g 时报错</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%97%AE%E9%A2%98%E5%8E%9F%E5%9B%A0-2"><span class="toc-number">1.6.2.1.</span> <span class="toc-text">问题原因</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%97%AE%E9%A2%98%E6%80%BB%E7%BB%93-1"><span class="toc-number">1.6.2.2.</span> <span class="toc-text">问题总结</span></a></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2023-10-17-%E7%AC%94%E8%AE%B0"><span class="toc-number">1.7.</span> <span class="toc-text">2023-10-17 笔记</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88"><span class="toc-number">1.7.1.</span> <span class="toc-text">解决方案</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2023-10-18-%E7%AC%94%E8%AE%B0"><span class="toc-number">1.8.</span> <span class="toc-text">2023-10-18 笔记</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%97%AE%E9%A2%98%E6%8F%8F%E8%BF%B0-2"><span class="toc-number">1.8.1.</span> <span class="toc-text">问题描述</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%97%AE%E9%A2%98%E5%8E%9F%E5%9B%A0-3"><span class="toc-number">1.8.2.</span> <span class="toc-text">问题原因</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2023-11-27-%E7%AC%94%E8%AE%B0"><span class="toc-number">1.9.</span> <span class="toc-text">2023-11-27 笔记</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%97%AE%E9%A2%98%E6%8F%8F%E8%BF%B0%EF%BC%9A"><span class="toc-number">1.9.1.</span> <span class="toc-text">问题描述：</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%97%AE%E9%A2%98%E5%8E%9F%E5%9B%A0%EF%BC%9A"><span class="toc-number">1.9.2.</span> <span class="toc-text">问题原因：</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88%EF%BC%9A"><span class="toc-number">1.9.3.</span> <span class="toc-text">解决方案：</span></a></li></ol></li></ol></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2025/01/05/other-%E9%9A%8F%E7%AC%94-icarus-%E4%B8%BB%E9%A2%98%E5%AE%89%E8%A3%85/" title="Hexo 配置 Icarus 主题"><img src="https://jsd.012700.xyz/gh/jerryc127/CDN/img/material-4.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Hexo 配置 Icarus 主题"/></a><div class="content"><a class="title" href="/2025/01/05/other-%E9%9A%8F%E7%AC%94-icarus-%E4%B8%BB%E9%A2%98%E5%AE%89%E8%A3%85/" title="Hexo 配置 Icarus 主题">Hexo 配置 Icarus 主题</a><time datetime="2025-01-05T08:25:00.000Z" title="发表于 2025-01-05 16:25:00">2025-01-05</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2024/03/18/other-leetcode-%E3%80%902024-03-18-LeetCode-%E5%88%B7%E9%A2%98-400%E9%81%93%E6%89%93%E5%8D%A1%E3%80%91/" title="LeetCode刷题400道打卡"><img src="https://jsd.012700.xyz/gh/jerryc127/CDN/img/material-9.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="LeetCode刷题400道打卡"/></a><div class="content"><a class="title" href="/2024/03/18/other-leetcode-%E3%80%902024-03-18-LeetCode-%E5%88%B7%E9%A2%98-400%E9%81%93%E6%89%93%E5%8D%A1%E3%80%91/" title="LeetCode刷题400道打卡">LeetCode刷题400道打卡</a><time datetime="2024-03-17T16:00:00.000Z" title="发表于 2024-03-18 00:00:00">2024-03-18</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2024/01/04/2024-01-05%20%E5%A4%9A%E6%A8%A1%E6%80%81%E6%A8%A1%E5%9E%8B%E7%BB%BC%E8%BF%B0/" title="多模态基础模型：从专家到通用助理"><img src="https://jsd.012700.xyz/gh/jerryc127/CDN/img/material-7.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="多模态基础模型：从专家到通用助理"/></a><div class="content"><a class="title" href="/2024/01/04/2024-01-05%20%E5%A4%9A%E6%A8%A1%E6%80%81%E6%A8%A1%E5%9E%8B%E7%BB%BC%E8%BF%B0/" title="多模态基础模型：从专家到通用助理">多模态基础模型：从专家到通用助理</a><time datetime="2024-01-04T14:42:08.000Z" title="发表于 2024-01-04 22:42:08">2024-01-04</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2023/12/30/%E6%A0%A1%E5%9B%AD%E7%BD%91%E8%87%AA%E5%8A%A8%E7%99%BB%E5%BD%95%E8%84%9A%E6%9C%AC/" title="校园网自动登录脚本"><img src="https://jsd.012700.xyz/gh/jerryc127/CDN/img/material-9.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="校园网自动登录脚本"/></a><div class="content"><a class="title" href="/2023/12/30/%E6%A0%A1%E5%9B%AD%E7%BD%91%E8%87%AA%E5%8A%A8%E7%99%BB%E5%BD%95%E8%84%9A%E6%9C%AC/" title="校园网自动登录脚本">校园网自动登录脚本</a><time datetime="2023-12-30T09:21:30.000Z" title="发表于 2023-12-30 17:21:30">2023-12-30</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2023/11/24/%E5%A4%9A%E6%A8%A1%E6%80%81%E8%AE%BD%E5%88%BA%E8%AF%86%E5%88%AB%E5%9F%BA%E7%BA%BF%E6%A8%A1%E5%9E%8B%E5%A4%8D%E7%8E%B0/" title="多模态讽刺识别基线模型复现"><img src="https://jsd.012700.xyz/gh/jerryc127/CDN/img/material-10.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="多模态讽刺识别基线模型复现"/></a><div class="content"><a class="title" href="/2023/11/24/%E5%A4%9A%E6%A8%A1%E6%80%81%E8%AE%BD%E5%88%BA%E8%AF%86%E5%88%AB%E5%9F%BA%E7%BA%BF%E6%A8%A1%E5%9E%8B%E5%A4%8D%E7%8E%B0/" title="多模态讽刺识别基线模型复现">多模态讽刺识别基线模型复现</a><time datetime="2023-11-24T08:51:18.000Z" title="发表于 2023-11-24 16:51:18">2023-11-24</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2022 - 2025 By David</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener external nofollow noreferrer" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text"><a href="http://www.beian.gov.cn/portal/registerSystemInfo" rel="external nofollow noreferrer" target="_blank"> <img style="vertical-align:middle; width:20px; " src="https://cdn.jsdelivr.net/gh/David-deng-01/images/blog/icp.png"> 赣公网安备36082302000135号</a> <a href="https://beian.miit.gov.cn/" rel="external nofollow noreferrer" id="beian"  target="_blank">赣ICP备2023013705号-1</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="日间和夜间模式切换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside-config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="translateLink" type="button" title="简繁转换">繁</button><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="/js/tw_cn.js"></script><script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script><div class="js-pjax"></div><script id="canvas_nest" defer="defer" color="0,0,255" opacity="0.7" zIndex="-1" count="99" mobile="false" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/canvas-nest.min.js"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>